<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="FolderBrowserDialog.aspx.cs" Inherits="Meridium.FolderBrowserProperty.Dialogs.FolderBrowserDialog" %>
<%@ Import Namespace="EPiServer.Shell"%>
<%@ Import Namespace="EPiServer.Shell.Web.UI"%>
<%@ Import Namespace="EPiServer.Shell.Web.Mvc.Html"%>
<%@ Register TagPrefix="EPiServer" Namespace="EPiServer.WebControls" Assembly="EPiServer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title><EPiServer:Translate runat="server" Text="/meridium.epcms/folderbrowser/heading" /></title>
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/App_Themes/Default/styles/system.css") %>">
    <link rel="stylesheet" type="text/css" href="<%=ResolveUrl("~/App_Themes/Default/styles/ToolButton.css") %>">
    <script type='text/javascript' src="<%= EPiServer.UriSupport.ResolveUrlFromUIBySettings("javascript/system.js") %>" ></script>
    <%=Page.ClientResources("Shell")%>
    <%=Page.ClientResources("ShellLightTheme")%>
    <%=Page.ClientResources("Navigation")%>    
    <link type="text/css" rel="stylesheet" href="<%= Paths.ToResource("CMS", "ClientResources/Epi/Base/CMS.css") %>" />    
    <script type="text/javascript">
        function OnCloseAndSave(dataPath) {
            var retObj = new Object();
            retObj.isOk = true;
            retObj.Path = dataPath;
            EPi.GetDialog().Close(retObj);
        }
        function OnCloseAndCancel() {
            EPi.GetDialog().Close();
        }
    </script>
</head>
    <body class="epiemptybackground">
        <form id="pathSelectorForm" runat="server">
            <div class="epi-padding-small"> 
                <h1><EPiServer:Translate runat="server" Text="/meridium.epcms/folderbrowser/heading" /></h1>
                <p><EPiServer:Translate runat="server" Text="/meridium.epcms/folderbrowser/intro" /></p>
                <asp:TreeView ID="FileTree" runat="server" DataSourceID="FileDataSource" ExpandDepth="0"
                    MaxDataBindDepth="6" OnTreeNodeDataBound="FileTree_TreeNodeDataBound"
                    ShowExpandCollapse="true" EnableClientScript="false"
                    PopulateNodesFromClient="true"
                    OnSelectedNodeChanged="FileTree_TreeNodeSelected">
                    <DataBindings>
                        <asp:TreeNodeBinding TextField="Name" ImageUrlField="ImageUrl" PopulateOnDemand="false" />
                    </DataBindings>
                    <SelectedNodeStyle Font-Bold="true" />
                    <NodeStyle HorizontalPadding="3" />
                </asp:TreeView>
                <br />
                <EPiServer:FileSystemDataSource runat="server" ID="FileDataSource" IncludeRoot="true" />
                <span class="epitoolbutton">    
                    <asp:Button ID="InsertButton" Translate="/meridium.epcms/folderbrowser/save" runat="server" OnClick="InsertButton_Click" />
                </span>
                &nbsp;&nbsp;
                <span class="epitoolbutton">    
                    <asp:Button ID="CancelButton" Translate="/meridium.epcms/folderbrowser/cancel" runat="server" OnClick="CancelButton_Click" />
                </span>
                <br /><br />    
            </div>
            <asp:HiddenField ID="ReturnValue" runat="server" />
        </form>
    </body>
</html>    